package com.stefan.lession01;

import java.awt.*;

public class TestFlowLayout {

    public static void main(String[] args) {
        Frame frame = new Frame("流式布局");

        // 组件-按钮
        Button button01 = new Button("button01");
        Button button02 = new Button("button02");
        Button button03 = new Button("button03");

        // 设置为流式布局
//        frame.setLayout(new FlowLayout());
//        frame.setLayout(new FlowLayout(FlowLayout.LEFT));
        frame.setLayout(new FlowLayout(FlowLayout.RIGHT));

        frame.setSize(200,200);

        // 把按钮添加上去
        frame.add(button01);
        frame.add(button02);
        frame.add(button03);

        frame.setVisible(true);
    }
}
